function saveFigure( fig, path, name )
%SAVEFIGURE Don't include the extension in name!

% Remove illigal characters..
name([find(name=='/') find(name==';') find(name=='\') find(name=='?') find(name=='*') ]) = '_';
disp(['Exporting to file: ' name]);

saveas(fig, [path name '.fig'])
set(fig, 'PaperUnits', 'centimeters');
set(fig, 'PaperType', 'A4');
set(fig, 'PaperOrientation', 'portrait');
set(fig, 'PaperPositionMode', 'manual');
set(fig, 'PaperPosition', [0.6 0.6 19.7 28.4 ]);

print(['-f' num2str(fig)], [path name '.eps'], '-depsc', '-r600');
print(['-f' num2str(fig)], [path name '.png'], '-dpng', '-r600');
print(['-f' num2str(fig)], [path name '.pdf'], '-dpdf', '-r600');

end